<?php

class blogController extends FrontController
{

	private $blogmodel = NULL;

	public function index()
	{
		unset($_GET['post']);
		$this->blogmodel = new blogModel($this->registry);
		$post = $this->blogmodel->FetchAll();
		$this->registry->response->view->post = $post;
		$this->registry->response->view->show('blog');
	}
	
	public function Post()
	{
		$this->blogmodel = new blogModel($this->registry);
		$post = $this->blogmodel->Post($_GET['message']);
		$this->index();
	}

	public function DeletePost()
	{
		$this->blogmodel = new blogModel($this->registry);
		$post = $this->blogmodel->Delete($_GET['deleteid']);
		$this->index();
	}
}

?>